home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / ATAN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  456 b   |  16 lines

  1. /* atan.c, FUNCTION FROM PAGE 198 C BIBLE */
  2. #include <stdio.h>
  3. #include <math.h>
  4. #include <stdlib.h>               /* errno is definde here */
  5. #define R_TO_D 57.29578            /* radian to degrees */
  6. main()
  7. {
  8.     double tanvalue, result;
  9.     printf("Enter value whose arctangent you want to evaluate: ");
  10.     scanf("%le", &tanvalue);
  11.     result = atan(tanvalue) * R_TO_D;
  12.     if(errno != EDOM)
  13.     {
  14.         rintf(" Arc tangent (%F) = %f deg.\n", tanvalue, result);
  15.     }
  16. }